package movie.test;

public class maopao {

	public static void main(String[] args) {
	
		int[] a = new int[6];
		a[0]=8;
		a[1]=0;
		a[2]=4;
		a[3]=6;
		a[4]=1;
		a[5]=9;
		maopao m = new maopao();
		//m.paixv(a);
		m.print(a);
		m.xuanze(a);
	}
	 /* public void paixv(int[] a){
		   for(int i=0;i<a.length-1;i++)
			   for(int j=0;j<a.length-i-1;j++){
				   if(a[j]>a[j+1]){
					   int temp=0;
					    temp = a[j];
					    a[j]= a[j+1];
					    a[j+1]=temp;
					   
				   }
			   }
	   }*/
     
	   public void xuanze(int[] a){
		  for(int i=0;i<a.length-1;i++){
			  for(int j=i+1;j<a.length;j++){
				  if(a[j]<a[i]){
					  int temp = a[i];
					  a[i]=a[j];
				      a[j]=temp;
				  }
				  print(a);   
			  }
		      System.out.println("---");
		  }
	   }
	  
	  public void print(int [] a){
		  for(int t :a){
			  System.out.print(t);
		  }
	  }
}
